//
//  YbrTextClassMusicItem.m
//  wifibox
//
//  Created by os X 10.9 on 15-1-9.
//  Copyright (c) 2015年 yinbaner. All rights reserved.
//

#import "YbrTextClassMusicItem.h"
#import "YbrClassInfoItem.h"
#import "YbrTimerUtil.h"

//@property (nonatomic) int ID;
//@property (nonatomic) int lineNum;
//@property (nonatomic, strong) NSString *name;
//@property (nonatomic, strong) NSString *audio_url;
//@property (nonatomic, strong) NSString *timelength;
//@property (nonatomic) int duration;


@implementation YbrTextClassMusicItem
+(YbrClassInfoItem *) TextClassToClassInfo:(YbrTextClassMusicItem *) textClassInfoItem{
     return [YbrTextClassMusicItem TextClassToClassInfo:textClassInfoItem index:textClassInfoItem.sort];
}

+(YbrClassInfoItem *) TextClassToClassInfo:(YbrTextClassMusicItem *) textClassInfoItem index:(int) index {
    if(textClassInfoItem == nil) {
        return nil;
    }
    
    YbrClassInfoItem *classInfoItem = [[YbrClassInfoItem alloc] init];
    classInfoItem.ID = textClassInfoItem._id;
    classInfoItem.name = textClassInfoItem.name;
    classInfoItem.audio_url = textClassInfoItem.audio_url;
    classInfoItem.timelength = [textClassInfoItem.timelength stringByReplacingOccurrencesOfString:@"." withString:@":"];
    classInfoItem.duration = [YbrTimerUtil makeTimeInt:classInfoItem.timelength];
    classInfoItem.lineNum = index;
    
    return classInfoItem;
}

@end
